#ifndef MYCANVAS_H
#define MYCANVAS_H

#include <QApplication>
#include <QFrame>
#include <iostream>
#include <ctime>
#include <cmath>
#include <vector>
#include "QSFMLCanvas.hpp"
#include "Carte.hpp"
#include "Etat.h"
#include "client.h"

class MyCanvas : public QSFMLCanvas
{
public :
    MyCanvas(QWidget* Parent, const QPoint& Position, const QSize& Size, Carte* b, Camp* c, int idJ, int* e, Client* cl);
    void setIdSelection(int x, int y);

    sf::Sprite& getS();
    sf::Sprite& getD();


private :
    void onInit();
    void onUpdate();

    bool isIn();
    bool isInFinTour();

    bool alreadySend;

    sf::Clock   clock;

    sf::Sprite s;
    sf::Sprite d;

    sf::Texture tF;
    sf::Sprite sF;

    int indiceSelection;
    int indiceSelection2;

    Carte* back;
    Camp* camps;
    int idJoueur;
    int* etat;
    Client* _client;
};

#endif // MYCANVAS_H
